@include('admin.header')
<link rel="stylesheet" href="/static/admin/bootstrap/css/bootstrap.min.css">

<div class="container-fluid">
    <form method="post" style="margin-top:100px" class="form-horizontal js-ajax-form" action="" novalidate="novalidate" enctype ="multipart/form-data">
        {{ csrf_field() }}
        <table class="table table-border table-bordered table-hover">
            <tr>
                <td>提现金额：</td>
                <td><input type="text" style="line-height:30;height:30px" class="input-text" name="amount"/></td>
            </tr>
            <tr>
                <td>提现卡号：</td>
                <td>
                    <select name="bank_no">
                        <option value="6214837843187257">章炳继6214837843187257</option>
                        <option value="6228480128548014173">李芙蓉6228480128548014173</option>
                        <option value="6214837845307051">李芙蓉6214837845307051</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center">
                    <span name="" id="submit" class="btn btn-success user_search"><i class="Hui-iconfont"></i> 确定提现</span>
                </td>
            </tr>
        </table>
    </form>
</div>

<script>
    $(function () {
        // 确认提现点击
        $('#submit').click(function(){
            layer.confirm('是否确定发起提现?', {
                btn: ['确定','取消']
            }, function () {
                $('#submit').hide();
                var $amount = $("[name=amount]").val();
                var $bank_no = $("[name=bank_no]").val();
                if($amount <= 0){
                    alert("提现金额有误");
                    return false;
                }
                $.post("{{url('fund/kjpay_withdrawal')}}" , {'amount':$amount,'bank_no':$bank_no} , function(result){
                    layer.alert(result.info, {
                        title: '提示',
                        icon: 2,
                    });
                    if(result.status != 1){
                        window.location.reload()
                    }
                } , 'json');
            });
        });
    });
</script>